package com.hdaccp.shuiguoD.controller;

import com.hdaccp.shuiguoD.entity.Huiyuan;
import com.hdaccp.shuiguoD.service.HuiyuanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/hyInfo")
@Scope("prototype")
public class HuiyuanInfoController {

    @Autowired
    //依赖注入
    public HuiyuanService huiyuanService;



    @RequestMapping("/delet")
    @ResponseBody
    public int delet(int hid){
        System.out.println(hid+"---");
        return huiyuanService.dele(hid);
    }

    @RequestMapping("/xg1")
    @ResponseBody
    public int xgl(Huiyuan huiyuaninfo){
        System.out.println(huiyuaninfo.getHid()+"---");
        return huiyuanService.upd(huiyuaninfo);
    }

    @RequestMapping("getqueryId")
    @ResponseBody
    public Huiyuan getqueryId(int hid){

        return huiyuanService.getById(hid);
    }

    @RequestMapping("/inst")
    @ResponseBody
    public int inst(Huiyuan huiyuaninfo){
        return huiyuanService.zj(huiyuaninfo);
    }

}
